package com.ita.dom.handler;

import java.io.IOException;
import java.util.List;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ita.dom.entity.WeiBo;

public class WeiBoReadeJsonHandler {

	
	public List<WeiBo> readJson(String json) {
		ObjectMapper mapper = new ObjectMapper();
		List<WeiBo> list = null;
		try {
		list = mapper.readValue(json,new TypeReference<List<WeiBo>>() {});
		} 
		catch (JsonParseException e) {
		     e.printStackTrace();
		} catch (JsonMappingException e) {
		    e.printStackTrace();
		} catch (IOException e) {
		     e.printStackTrace();
		}
		System.out.println(list);
		System.out.println("read json end");
		return list;
	}
}
